package com.cooper.dao.seller;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.Insert;
import net.paoding.rose.jade.annotation.ReturnGeneratedKeys;
import net.paoding.rose.jade.annotation.SQL;

import com.cooper.entity.ShopStatEntity;

@DAO
public interface ShopStatDAO {
	
	static final String TABLE_NAME = "d_shop_stat";
	
	@ReturnGeneratedKeys
	@Insert(tableName=TABLE_NAME)
	Long saveEntity(ShopStatEntity entity) throws Exception;
	
	@SQL("select * from  d_shop_stat where seller_id=:1")
	ShopStatEntity loadBySellerId(Long sellerId) throws Exception;
	
	@SQL("update d_shop_stat set like_num=like_num+1 where deleted='n' and seller_id=:1 ")
	void like(Long sellerId) throws Exception;
	
	@SQL("update d_shop_stat set unlike_num=unlike_num+1 where deleted='n' and seller_id=:1 ")
	void unlike(Long sellerId) throws Exception;
	
}
